package com.googlecode.scenemaker3d.view.timeline
{
	import com.googlecode.scenemaker3d.events.KeyFrameMoveEvent;
	
	import flash.events.ContextMenuEvent;
	import flash.events.Event;
	
	import com.googlecode.scenemaker3d.model.VO_Object3D;
	
	import org.papervision3d.core.math.Number3D;
	
	public class KeyFrame extends SnapDraggableObj
	{
		private var keyFrameID:String;
		private var t:Number = 0;
		private var p:Number3D;
		private var VO:VO_Object3D;
		
		public function KeyFrame(w:uint, id:String)
		{
			super(w);
			
			this.keyFrameID = id;
			this.graphics.beginFill(0x000000);
			this.graphics.drawCircle(w/2, w/2, w/2);
			this.addEventListener("objectUp", onThumbUp);
			this.addEventListener("objectMove", onThumbMove);
		}
		private function onThumbUp(e:Event):void
		{
			this.dispatchEvent(new KeyFrameMoveEvent(KeyFrameMoveEvent.KEY_FRAME_MOVE, this));
		}
		private function onThumbMove(e:Event):void
		{
			//
		}
		private function onRightClick(e:ContextMenuEvent):void
		{
			this.dispatchEvent(e);
		}
		public function get id():String
		{
			return this.keyFrameID;
		}
		public function set objPos(pos:Number3D):void
		{
			p = pos; 
		}
		public function get objPos():Number3D
		{
			return p;
		}
		public function set object3D(VO:VO_Object3D):void
		{
			this.VO = VO;
		}
		public function get object3D():VO_Object3D
		{
			return VO;
		}
		/* override protected function update():void
		{
			this.dispatchEvent(new KeyFrameMoveEvent(KeyFrameMoveEvent.KEY_FRAME_MOVE, this));
		} */
	}
}